package com.party.core.model.mall;

import com.party.core.model.BaseModel;

/**
 * 展示商品
 * Created by wei.li
 *
 * @date 2017/8/24 0024
 * @time 15:08
 */
public class MallShowGoods extends BaseModel {

    public static int TYPE_CATEGORY = 1;
    public static int TYPE_GOODS = 2;

    //商品名称
    private String name;

    //商品图片
    private String pic;

    //商品链接
    private String url;

    //类型编号
    private String categoryId;

    //会员编号
    private String memberId;

    //数量说明
    private String numExplain;

    //排序
    private int  sort;

    // 1：分类 2：商品
    private Integer type;

    private String targetId;

    // 专题编号
    private String subjectId;

    // 模板编号
    private String templateId;

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getTargetId() {
        return targetId;
    }

    public void setTargetId(String targetId) {
        this.targetId = targetId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(String categoryId) {
        this.categoryId = categoryId;
    }

    public String getMemberId() {
        return memberId;
    }

    public void setMemberId(String memberId) {
        this.memberId = memberId;
    }

    public String getNumExplain() {
        return numExplain;
    }

    public void setNumExplain(String numExplain) {
        this.numExplain = numExplain;
    }

    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }

    public String getSubjectId() {
        return subjectId;
    }

    public void setSubjectId(String subjectId) {
        this.subjectId = subjectId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;

        MallShowGoods that = (MallShowGoods) o;

        if (sort != that.sort) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (pic != null ? !pic.equals(that.pic) : that.pic != null) return false;
        if (url != null ? !url.equals(that.url) : that.url != null) return false;
        if (categoryId != null ? !categoryId.equals(that.categoryId) : that.categoryId != null) return false;
        if (memberId != null ? !memberId.equals(that.memberId) : that.memberId != null) return false;
        return numExplain != null ? numExplain.equals(that.numExplain) : that.numExplain == null;

    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (pic != null ? pic.hashCode() : 0);
        result = 31 * result + (url != null ? url.hashCode() : 0);
        result = 31 * result + (categoryId != null ? categoryId.hashCode() : 0);
        result = 31 * result + (memberId != null ? memberId.hashCode() : 0);
        result = 31 * result + (numExplain != null ? numExplain.hashCode() : 0);
        result = 31 * result + sort;
        return result;
    }

    @Override
    public String toString() {
        return "MallShowGoods{" +
                "name='" + name + '\'' +
                ", pic='" + pic + '\'' +
                ", url='" + url + '\'' +
                ", categoryId='" + categoryId + '\'' +
                ", memberId='" + memberId + '\'' +
                ", numExplain='" + numExplain + '\'' +
                ", sort='" + sort + '\'' +
                '}';
    }

    public String getTemplateId() {
        return templateId;
    }

    public void setTemplateId(String templateId) {
        this.templateId = templateId;
    }
}
